package com.example.recuitactivity.observe;

import com.example.recuitactivity.bean.Candidate;
import com.example.recuitactivity.helper.DbOpenHelper;

import java.util.ArrayList;
import java.util.List;

public abstract class AbstractSubject {
    protected List<Candidate> objeactList=new ArrayList<>();
    public abstract void attachCandidates(Candidate candidate);
    public abstract void detachCandidates(Candidate candidate);

    public void notifyToAllCandidates( DbOpenHelper dbOpenHelper){
        for(Candidate candidate:objeactList){
            candidate.update(dbOpenHelper);
        }
    }
}
